package com.example.function.sys.controller;

import com.example.common.support.AjaxResponse;
import com.example.common.support.CP_GlobalNamingConstant;
import com.example.common.support.CP_OperateLog;
import com.example.function.sys.model.one.SysPost;
import com.example.function.sys.service.ISysPostService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * Description: <sys模块controller >. <br>
 * <p>
 * <基本的crud>
 * </p>
 * generate time:2021-7-26 15:18:15
 *
 * @author hanqf
 * @version V1.0
 */

@RestController
@Slf4j
@RequestMapping("/sys")
public class SysPostController {


    @Resource(name = "sysPostService")
    protected ISysPostService sysPostService;


    /**
     * 查询全部岗位.
     *
     * @return AjaxResponse
     */
    @RequestMapping(value = "/posts")
    @CP_OperateLog(value = "查询全部岗位", type = CP_GlobalNamingConstant.OPERATE_LIST)
    public AjaxResponse sysPosts() {
        final List<SysPost> sysPostList = sysPostService.findAll();
        return AjaxResponse.success(sysPostList);
    }


}

